import request from '@/utils/request'
export function getEnterpriseListAPI(params) {
  return request({
    url: 'park/enterprise',
    params
  })
}
//  https://api-hmzs.itheima.net/v1/park/industry
export function getIndustryAPI() {
  return request({
    url: 'park/industry'
  })
}
// https://api-hmzs.itheima.net/v1/park/enterprise
export function addEnterpriseAPI(data) {
  return request({
    url: 'park/enterprise',
    method: 'POST',
    data
  })
}
/**
 * 获取合同详情
 * @param {*} id
 * @returns
 */
export function getEnterpriseDetailAPI(id) {
  return request({
    url: `/park/enterprise/${id}`
  })
}
// 编辑接口
export function updateExterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'PUT',
    data
  })
}
// 删除接口
//  https://api-hmzs.itheima.net/v1/park/enterprise/{id}
export function deleteEnterpriseApi(id) {
  return request({
    url: `park/enterprise/${id}`,
    method: 'DELETE'
  })
}
// 获取可租赁的楼宇
// https://api-hmzs.itheima.net/v1/park/rent/building
export function rentBulidApi() {
  return request({
    url: 'park/rent/building'
  })
}
// 添加租赁合同
export function createRentAPI(data) {
  return request({
    url: '/park/enterprise/rent',
    method: 'POST',
    data
  })
}
// https://api-hmzs.itheima.net/v1/park/enterprise/rent/{id}
// 展开查看详情
export function enterpriseRent(id) {
  return request({
    url: `https://api-hmzs.itheima.net/v1/park/enterprise/rent/${id}`
  })
}

//  https://api-hmzs.itheima.net/v1/park/enterprise/rent/{id}
// 退租
export function enterpriseRentAPi(id) {
  return request({
    url: `https://api-hmzs.itheima.net/v1/park/enterprise/rent/${id}`,
    method: 'put'
  })
}
